package cn.bs.allensocket.mythread;

/**
 * Created by Allen on 2014/11/4.
 */
public class Foo {
    public int x = 100;

    public synchronized int getX() {
        return x;
    }

    public int fix(int y){
        synchronized(this) {
            x = x - y;
            return x;
        }
    }

}
